package com.sunnay.controller;

import com.sunnay.entity.AppUserOrderEntity;
import com.sunnay.service.AppUserOrderService;
import com.sunnay.util.R;
import com.sunnay.vo.common.Page;
import com.sunnay.vo.order.QueryOrderVo;
import com.sunnay.web.ContextHelper;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/order")
public class OrderController {

    @Resource
    private AppUserOrderService appUserOrderService;

    @GetMapping("/list")
    public R<List<AppUserOrderEntity>> orderList(QueryOrderVo queryOrderVo, Page page){
        return R.ok(appUserOrderService.orderList(ContextHelper.getSystemUser(), queryOrderVo, page));
    }
}
